package cn.com.bluemoon.daps.standard.api;

import cn.com.bluemoon.daps.common.annotation.FcApiFor;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiStandard;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.standard.api.factory.RemoteCategoryFallbackFactory;
import cn.com.bluemoon.daps.standard.entity.DapSystemCategory;
import cn.com.bluemoon.daps.standard.vo.SysTopicCategorySimpleVo;
import cn.com.bluemoon.daps.standard.vo.SystemCategoryTreeVo;
import cn.com.bluemoon.daps.standard.vo.TopicCategoryVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Map;

@FeignClient(value = DapsApiStandard.SERVICE, fallbackFactory = RemoteCategoryFallbackFactory.class)
@RequestMapping(DapsApiStandard.BASE_URI + DapsApiStandard.API_SYS_CATEGORY)
@ApiIgnore
public interface RemoteSystemCategoryService {

    @GetMapping("/category")
    @FcApiFor(team = {"数据资产团队", "数据工具团队"})
    ResultBean<List<DapSystemCategory>> getSystemCategories(@RequestParam("ids") List<String> ids);

    /**
     * 获取系统下的主题分类
     *
     * @return
     */
    @GetMapping("/sysCategories")
    public ResultBean<Map<String, List<DapSystemCategory>>> sysCategories();

    /**
     * 根据id获取主题/分类
     */
    @GetMapping
    public ResultBean<TopicCategoryVo> getById(@RequestParam("cId") String cId);

    /** 主题分类树 */
    @GetMapping("/tree")
    ResultBean<List<SystemCategoryTreeVo>> categoryTree();

    @GetMapping("/list")
    ResultBean<List<SysTopicCategorySimpleVo>> sysTopicCategories();
}
